classdef PathAnalyzer
%PATHANALYZER Stores a path in form x,y,z,t and plots it
%   can store, analyze and plot a Path. Constructor takes XYZT lists of
%   values. Size is used to determine how big to make the dots so they are
%   visible. Vertical is used incase there are multi-levels. This is not
%   implemented yet. COnstructor replaced by jus settign each of the
%   properties. FIX THIS LATER WITH 3 lines of code.

   properties
       
       X;                   %x coordinate vector         
       Y;                   %y coordiante vector
       Z;                   %z coordinate vector
       T;                   %time
       Size = 3;            %size of dots
       Vertical = 0;        %multi-level or not
   end

   methods
       %accessors and setters   
       function obj = set.X(obj, x)
           obj.X = x;
       end
       
       function obj = set.Y(obj, y)
           obj.Y = y;
       end
       function obj = set.Z(obj, z)
           obj.Z = z;
       end
       function obj = set.T(obj,t)
           obj.T = t;
       end
       function obj = set.Size(obj, size)
           obj.Size = size;
       end
       
       function obj = SetMultiLevel(obj)
           obj.Vertical = 1;
       end
       
       function obj = NoMultiLevel(obj)
           obj.Vertical = 0;
       end
       
       
         
       %main function to plot the Path.
       %hold_on is used to save what was previously in the plot
       %    this is used to overlay things, like stps, floorplans
       %time is used to show a colorbar of the poitns in order
       %    this will give sequence
       %z is used for multi-levels
       %    under this case, a 3d plot will be used
       %    it is recommended to do things floor by floor instead
       function Plot(obj, hold_on, time,z)
           
           %do not overwrite previous plot, add to it
           if hold_on
               hold on
           end
           
           if time && ~z
               colormap('hot');
               scatter(obj.X, obj.Y, obj.Size, obj.T);
               colorbar;
           else
               scatter(obj.X, obj.Y, obj.Size);
           end
       end
   end
end 
